package hw048901.lesson1;

import java.util.ArrayList;

public class printInt extends Prints{
	
	public printInt(ArrayList pIntList1)
	{
		 //this.pIntList = pIntList1;
		super(pIntList1);
		
	}
	
	public printInt()
	{
		 //this.pIntList = pIntList1;
		super();
		
	}
	
   public boolean Break(Integer o1)
   {
	   boolean isBreak=false;
	   //for (Integer o:pIntList){
	   for (Integer o:(ArrayList<Integer>)super.getpList()){
	    	if (o1.equals(o)) 
	    	{
	    		isBreak = true;
	    		break;
	    	}
	    }
	  return isBreak; 
	}
   public boolean BreakT(Integer o1)
   {
	   boolean isBreak=false;
	   //for (Integer o:pIntList){
	   for (Integer o:(ArrayList<Integer>)super.getPtList()){
	    	if (o1.equals(o)) 
	    	{
	    		isBreak = true;
	    		break;
	    	}
	    }
	  return isBreak; 
	}   
	public static  void main(String[] args)
	  {
		boolean ib;
		int i,j;
		ArrayList<Integer> a = new ArrayList();
		j=100;
		for (i=1;i<=j;i++)
		{
			a.add(i);
		}
		//method 1
		printInt p=new printInt(a);
		p.printStr();
		System.out.println("");
		ib = p.Break(new Integer(47));
		if(ib)
		{
			System.out.println("find the objecdt 10 break success!");
		}
		else
		{
			System.out.println("not find the objecdt 10 break failed!");
		}
		// method 2
		printInt pt=new printInt();
		pt.setPtList(a);
		pt.printPtList();
		System.out.println("");
		ib = pt.BreakT(new Integer(47));
		if(ib)
		{
			System.out.println("find the objecdt 10 break success!");
		}
		else
		{
			System.out.println("not find the objecdt 10 break failed!");
		}
	  }

}
